package top.haichi.webpaper.utils;

import java.util.regex.Pattern;

public class PatternsUtils {
    public static final String NUMBER_PATTERN = "-?[0-9]+(\\.[0-9]+)?";
    public static final String EMAIL_PATTERN = "^(\\w+([-.][A-Za-z0-9]+)*){3,18}@\\w+([-.][A-Za-z0-9]+)*\\.\\w+([-.][A-Za-z0-9]+)*$";

    public static boolean match(String string, String pattern) {
        if (string.matches(pattern)) {
            return true;
        }
        return false;

    }
}
